Skip to content

fix: repair cross-package bugs so tests and tsc pass - #85

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2579-1784824685
Open

fix: repair cross-package bugs so tests and tsc pass#85
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2579-1784824685

Conversation

@stooit

@stooit stooit commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors across the monorepo. bun test (13 pass, 0 fail) and tsc --noEmit (clean) both green.

Changes

  • apps/web/src/lib/api.tspackages/utils renamed its hook useThrottleuseDebounce, but api.ts still imported the old name (and re-exported it as useSearchDebounce). Updated the import and re-export to the new name.
  • packages/ui/src/components/Button/Button.tsx — the component destructured an aria-label prop but never rendered it. Now passes it through; icon-only buttons always emit the attribute so they expose an accessible name (WCAG 4.1.2).
  • packages/ui/src/components/DataTable/DataTable.tsx — the sort-direction toggle read the stale closed-over sortDir. Switched to the functional-updater form (setSortDir(prev => ...)) to fix the stale-closure bug caught by the controlled re-render test.
  • packages/utils/src/format/date.ts — used a format that zero-padded the day. Switched to Intl.DateTimeFormat("en-AU", { day: "numeric", month: "2-digit", year: "numeric" }) so day-first output has no leading zero on the day (e.g. 1/03/2024) while keeping a 4-digit year.
  • bunfig.toml / packages/ui/bunfig.toml — configured the UI test suite to run under happy-dom so document is defined for @testing-library/react.
  • tsconfig.json — added bun-types to compilerOptions.types so tsc resolves the bun:test virtual module.

Constraints honoured

  • No test files modified.
  • No new dependencies added (happy-dom, @happy-dom/global-registrator, and bun-types were already installed).
  • Changes are minimal and scoped to the reported failures.

Verification

  • bun test → 13 pass, 0 fail
  • tsc --noEmit → clean

- api.ts: import renamed hook useDebounce (was useThrottle) from @e2e/utils
- Button: pass aria-label through so icon-only buttons expose an accessible name
- DataTable: use functional updater in sort toggle to fix stale-closure bug
- date.ts: use en-AU day-first numeric-day format (1/03/2024 not 01/03/2024)
- bunfig.toml: run UI tests under happy-dom so `document` is defined
- tsconfig.json: add bun-types so tsc resolves the bun:test module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant